use gdk_cursor_unref instead of destroy
authorHavoc Pennington <hp@pobox.com>
Sat, 29 Jan 2000 22:26:41 +0000 (22:26 +0000)
committerHavoc Pennington <hp@src.gnome.org>
Sat, 29 Jan 2000 22:26:41 +0000 (22:26 +0000)
2000-01-30  Havoc Pennington  <hp@pobox.com>

* gtk/testgtk.c (set_cursor): use gdk_cursor_unref instead of
destroy

* gdk/gdkimage.c (gdk_image_ref): image wasn't being returned

* gdk/gdkprivate.h: declare
_gdk_cursor_destroy which is then
implemented in platform-specific code

* gdk/Makefile.am (gdk_c_sources): add gdkcursor.c

* gdk/x11/gdkcursor-x11.c (gdk_cursor_destroy):
rename with an
underscore in front

* gdk/win32/gdkcursor-win32.c (gdk_cursor_destroy):
put an underscore in front

* gdk/gdkcursor.c: new file, implements
gdk_cursor_ref/gdk_cursor_unref

* gdk/gdkcursor.h: Refcount GdkCursor

* gdk/gdkcompat.h
(gdk_cursor_destroy): compat

16 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/Makefile.am
gdk/gdkcompat.h
gdk/gdkcursor.h
gdk/gdkimage.c
gdk/gdkprivate.h
gdk/win32/gdkcursor-win32.c
gdk/x11/gdkcursor-x11.c
gtk/testgtk.c
tests/testgtk.c

index 30717164b9f898d3b05b754eb65dacfc808bcebb..3aad692d0c3309a24be658f2b03012d2c4a648be 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2000-01-30  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/testgtk.c (set_cursor): use gdk_cursor_unref instead of
+       destroy
+
+       * gdk/gdkimage.c (gdk_image_ref): image wasn't being returned
+
+       * gdk/gdkprivate.h: declare _gdk_cursor_destroy which is then 
+       implemented in platform-specific code
+
+       * gdk/Makefile.am (gdk_c_sources): add gdkcursor.c
+
+       * gdk/x11/gdkcursor-x11.c (gdk_cursor_destroy): rename with an
+       underscore in front
+
+       * gdk/win32/gdkcursor-win32.c (gdk_cursor_destroy):
+       put an underscore in front
+
+       * gdk/gdkcursor.c: new file, implements
+       gdk_cursor_ref/gdk_cursor_unref
+
+       * gdk/gdkcursor.h: Refcount GdkCursor
+
+       * gdk/gdkcompat.h (gdk_cursor_destroy): compat
+
 2000-01-29  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/gdkwindow.h
index 30717164b9f898d3b05b754eb65dacfc808bcebb..3aad692d0c3309a24be658f2b03012d2c4a648be 100644 (file)
@@ -1,3 +1,28 @@
+2000-01-30  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/testgtk.c (set_cursor): use gdk_cursor_unref instead of
+       destroy
+
+       * gdk/gdkimage.c (gdk_image_ref): image wasn't being returned
+
+       * gdk/gdkprivate.h: declare _gdk_cursor_destroy which is then 
+       implemented in platform-specific code
+
+       * gdk/Makefile.am (gdk_c_sources): add gdkcursor.c
+
+       * gdk/x11/gdkcursor-x11.c (gdk_cursor_destroy): rename with an
+       underscore in front
+
+       * gdk/win32/gdkcursor-win32.c (gdk_cursor_destroy):
+       put an underscore in front
+
+       * gdk/gdkcursor.c: new file, implements
+       gdk_cursor_ref/gdk_cursor_unref
+
+       * gdk/gdkcursor.h: Refcount GdkCursor
+
+       * gdk/gdkcompat.h (gdk_cursor_destroy): compat
+
 2000-01-29  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/gdkwindow.h
index 30717164b9f898d3b05b754eb65dacfc808bcebb..3aad692d0c3309a24be658f2b03012d2c4a648be 100644 (file)
@@ -1,3 +1,28 @@
+2000-01-30  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/testgtk.c (set_cursor): use gdk_cursor_unref instead of
+       destroy
+
+       * gdk/gdkimage.c (gdk_image_ref): image wasn't being returned
+
+       * gdk/gdkprivate.h: declare _gdk_cursor_destroy which is then 
+       implemented in platform-specific code
+
+       * gdk/Makefile.am (gdk_c_sources): add gdkcursor.c
+
+       * gdk/x11/gdkcursor-x11.c (gdk_cursor_destroy): rename with an
+       underscore in front
+
+       * gdk/win32/gdkcursor-win32.c (gdk_cursor_destroy):
+       put an underscore in front
+
+       * gdk/gdkcursor.c: new file, implements
+       gdk_cursor_ref/gdk_cursor_unref
+
+       * gdk/gdkcursor.h: Refcount GdkCursor
+
+       * gdk/gdkcompat.h (gdk_cursor_destroy): compat
+
 2000-01-29  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/gdkwindow.h
index 30717164b9f898d3b05b754eb65dacfc808bcebb..3aad692d0c3309a24be658f2b03012d2c4a648be 100644 (file)
@@ -1,3 +1,28 @@
+2000-01-30  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/testgtk.c (set_cursor): use gdk_cursor_unref instead of
+       destroy
+
+       * gdk/gdkimage.c (gdk_image_ref): image wasn't being returned
+
+       * gdk/gdkprivate.h: declare _gdk_cursor_destroy which is then 
+       implemented in platform-specific code
+
+       * gdk/Makefile.am (gdk_c_sources): add gdkcursor.c
+
+       * gdk/x11/gdkcursor-x11.c (gdk_cursor_destroy): rename with an
+       underscore in front
+
+       * gdk/win32/gdkcursor-win32.c (gdk_cursor_destroy):
+       put an underscore in front
+
+       * gdk/gdkcursor.c: new file, implements
+       gdk_cursor_ref/gdk_cursor_unref
+
+       * gdk/gdkcursor.h: Refcount GdkCursor
+
+       * gdk/gdkcompat.h (gdk_cursor_destroy): compat
+
 2000-01-29  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/gdkwindow.h
index 30717164b9f898d3b05b754eb65dacfc808bcebb..3aad692d0c3309a24be658f2b03012d2c4a648be 100644 (file)
@@ -1,3 +1,28 @@
+2000-01-30  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/testgtk.c (set_cursor): use gdk_cursor_unref instead of
+       destroy
+
+       * gdk/gdkimage.c (gdk_image_ref): image wasn't being returned
+
+       * gdk/gdkprivate.h: declare _gdk_cursor_destroy which is then 
+       implemented in platform-specific code
+
+       * gdk/Makefile.am (gdk_c_sources): add gdkcursor.c
+
+       * gdk/x11/gdkcursor-x11.c (gdk_cursor_destroy): rename with an
+       underscore in front
+
+       * gdk/win32/gdkcursor-win32.c (gdk_cursor_destroy):
+       put an underscore in front
+
+       * gdk/gdkcursor.c: new file, implements
+       gdk_cursor_ref/gdk_cursor_unref
+
+       * gdk/gdkcursor.h: Refcount GdkCursor
+
+       * gdk/gdkcompat.h (gdk_cursor_destroy): compat
+
 2000-01-29  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/gdkwindow.h
index 30717164b9f898d3b05b754eb65dacfc808bcebb..3aad692d0c3309a24be658f2b03012d2c4a648be 100644 (file)
@@ -1,3 +1,28 @@
+2000-01-30  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/testgtk.c (set_cursor): use gdk_cursor_unref instead of
+       destroy
+
+       * gdk/gdkimage.c (gdk_image_ref): image wasn't being returned
+
+       * gdk/gdkprivate.h: declare _gdk_cursor_destroy which is then 
+       implemented in platform-specific code
+
+       * gdk/Makefile.am (gdk_c_sources): add gdkcursor.c
+
+       * gdk/x11/gdkcursor-x11.c (gdk_cursor_destroy): rename with an
+       underscore in front
+
+       * gdk/win32/gdkcursor-win32.c (gdk_cursor_destroy):
+       put an underscore in front
+
+       * gdk/gdkcursor.c: new file, implements
+       gdk_cursor_ref/gdk_cursor_unref
+
+       * gdk/gdkcursor.h: Refcount GdkCursor
+
+       * gdk/gdkcompat.h (gdk_cursor_destroy): compat
+
 2000-01-29  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/gdkwindow.h
index 30717164b9f898d3b05b754eb65dacfc808bcebb..3aad692d0c3309a24be658f2b03012d2c4a648be 100644 (file)
@@ -1,3 +1,28 @@
+2000-01-30  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/testgtk.c (set_cursor): use gdk_cursor_unref instead of
+       destroy
+
+       * gdk/gdkimage.c (gdk_image_ref): image wasn't being returned
+
+       * gdk/gdkprivate.h: declare _gdk_cursor_destroy which is then 
+       implemented in platform-specific code
+
+       * gdk/Makefile.am (gdk_c_sources): add gdkcursor.c
+
+       * gdk/x11/gdkcursor-x11.c (gdk_cursor_destroy): rename with an
+       underscore in front
+
+       * gdk/win32/gdkcursor-win32.c (gdk_cursor_destroy):
+       put an underscore in front
+
+       * gdk/gdkcursor.c: new file, implements
+       gdk_cursor_ref/gdk_cursor_unref
+
+       * gdk/gdkcursor.h: Refcount GdkCursor
+
+       * gdk/gdkcompat.h (gdk_cursor_destroy): compat
+
 2000-01-29  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/gdkwindow.h
index 134fc1881af9f4976bcc108ffeebe35dcc220141..5130ac1c70bfa1fc06d9dc961db24ffbfe9eeb17 100644 (file)
@@ -76,6 +76,7 @@ gdk_public_h_sources = @STRIP_BEGIN@ \
 gdk_c_sources = @STRIP_BEGIN@ \
        gdk.c           \
        gdkcolor.c      \
+       gdkcursor.c     \
        gdkdraw.c       \
        gdkevents.c     \
        gdkfont.c       \
index d82d8f69d93696d6164db0ea33b60824510b2450..b078370869eafe39ee33c34b53345aaec1e0dfe4 100644 (file)
@@ -34,6 +34,8 @@ extern "C" {
 
 #define gdk_gc_destroy                 gdk_gc_unref
 #define gdk_image_destroy              gdk_image_unref
+#define gdk_cursor_destroy             gdk_cursor_unref
+
 
 #define GDK_WINDOW_PIXMAP GDK_DRAWABLE_PIXMAP
              
index 14f6e4414d5fce01f47b003fef0eaad0596f92eb..fd28ce89f5e83c45d4f00bd46e0daface5aae7a7 100644 (file)
@@ -19,6 +19,7 @@ typedef enum
 struct _GdkCursor
 {
   GdkCursorType type;
+  guint refcount;
 };
 
 /* Cursors
@@ -30,7 +31,8 @@ GdkCursor* gdk_cursor_new_from_pixmap  (GdkPixmap       *source,
                                          GdkColor        *bg,
                                          gint             x,
                                          gint             y);
-void      gdk_cursor_destroy            (GdkCursor      *cursor);
+GdkCursor* gdk_cursor_ref                (GdkCursor      *cursor);
+void       gdk_cursor_unref              (GdkCursor      *cursor);
 
 #ifdef __cplusplus
 }
index 09ae112b6ddd0e0c2df169691316aeeef75c1bb5..1e82d50df2b2ee24ff597e00be08fc8431a22bc2 100644 (file)
@@ -38,6 +38,8 @@ gdk_image_ref (GdkImage *image)
   g_return_val_if_fail (image != NULL, NULL);
 
   private->ref_count++;
+
+  return image;
 }
 
 void
index 8d32599d94c038a92bb375d23158c392b40e79cb..4eefea9e44aa90b4f1ebff5d27aea65d65be18d0 100644 (file)
@@ -262,6 +262,8 @@ void _gdk_font_destroy (GdkFont *font);
 
 void _gdk_colormap_real_destroy (GdkColormap *colormap);
 
+void _gdk_cursor_destroy (GdkCursor *cursor);
+
 /* Initialization */
 
 extern GdkArgDesc _gdk_windowing_args[];
index a8d1760d66c2bec463345cd9f14b3e50bd93a452..c887a45568613351e99016b2e178cae5864ee1a1 100644 (file)
@@ -255,7 +255,7 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source,
 }
 
 void
-gdk_cursor_destroy (GdkCursor *cursor)
+_gdk_cursor_destroy (GdkCursor *cursor)
 {
   GdkCursorPrivate *private;
 
index 66d0f34ddc66cfa020554c5eb4966ae01c8fd896..974135208e4bca3cf4a9733d96183ed8ca61c50a 100644 (file)
@@ -79,7 +79,7 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source, GdkPixmap *mask, GdkColor *fg, Gd
 }
 
 void
-gdk_cursor_destroy (GdkCursor *cursor)
+_gdk_cursor_destroy (GdkCursor *cursor)
 {
   GdkCursorPrivate *private;
 
index 5a3d9993be5861cd2d7dac84b9b190a534adb758..c004a077f53f0549c047d63657818a51ff68683e 100644 (file)
@@ -3270,7 +3270,7 @@ set_cursor (GtkWidget *spinner,
 
   cursor = gdk_cursor_new (c);
   gdk_window_set_cursor (widget->window, cursor);
-  gdk_cursor_destroy (cursor);
+  gdk_cursor_unref (cursor);
 }
 
 static gint
index 5a3d9993be5861cd2d7dac84b9b190a534adb758..c004a077f53f0549c047d63657818a51ff68683e 100644 (file)
@@ -3270,7 +3270,7 @@ set_cursor (GtkWidget *spinner,
 
   cursor = gdk_cursor_new (c);
   gdk_window_set_cursor (widget->window, cursor);
-  gdk_cursor_destroy (cursor);
+  gdk_cursor_unref (cursor);
 }
 
 static gint